import React from 'react';

class Comp1 extends React.Component {
  render() {
    const { count, onCount } = this.props
    return (
      <div>
        <h2>子组件</h2>
        <div>{count}</div>
        <button onClick={() => onCount()}>+1</button>
      </div>  
    )
  }
}

export default Comp1